package 第7场_小白入门赛;

import java.util.Scanner;

public class _02 {
	public static void main(String[] args) {
		
		int arr[][] = {
				{1,1,1,1,1,1,0},
				{0,1,1,0,0,0,0},
				{1,1,0,1,1,0,1},
				{1,1,1,1,0,0,1},
				{0,1,1,0,0,1,1},
				{1,0,1,1,0,1,1},
				{1,0,1,1,1,1,1},
				{1,1,1,0,0,0,0},
				{1,1,1,1,1,1,1},
				{1,1,1,1,0,1,1}
				};
		
		Scanner scan = new Scanner(System.in);
		
		char[] a = scan.nextLine().toCharArray();
		char[] b = scan.nextLine().toCharArray();
		
		
		
		int count = 0;
		for(int i = 0; i < 7; i++) {
			for(int j = 0; j < a.length;j++) {
				if(arr[a[j]-'0'][i] - arr[b[j]-'0'][i] != 0) {
					count++;
				}
			}
		}
		
		System.out.print(count);
		scan.close();
	}
}
